package com.ywwl.service;

import com.github.pagehelper.PageInfo;
import com.ywwl.domain.table.SysRole;
import com.ywwl.util.response.ResponseMsg;

import java.util.HashMap;
import java.util.List;

public interface RoleService {

    /**
     *
     * @return
     * @throws Exception
     */
    List<SysRole> list() throws  Exception;

    /**
     *
     * @param whereMap
     * @param pageIndex
     * @param pageSize
     * @param orderMap
     * @return
     * @throws Exception
     */
    PageInfo<SysRole> listByPage(HashMap<String, String> whereMap, int pageIndex, int pageSize, HashMap<String, String> orderMap) throws Exception;

    /**
     * 根据角色标识查询角色信息
     *
     * @param id
     * @return
     * @throws Exception
     */
    SysRole selectByPrimaryKey(int id) throws Exception;

    /**
     * 根据角色名称查询角色信息
     *
     * @param hashMap
     * @return
     * @throws Exception
     */
    SysRole selectByWhere(HashMap<String, String> hashMap) throws Exception;

    /**
     * 角色添加
     *
     * @param role
     * @return
     * @throws Exception
     */
    ResponseMsg insert(SysRole role) throws Exception;

    /**
     * 角色修改
     *
     * @param role
     * @return
     * @throws Exception
     */
    ResponseMsg update(SysRole role) throws Exception;

    /**
     * 角色删除
     *
     * @param id
     * @return
     * @throws Exception
     */
    ResponseMsg delete(int id) throws Exception;
}
